<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<%@ taglib prefix="sec"
	uri="http://www.springframework.org/security/tags"%>

<s:include value="../header.jsp"></s:include>
<s:include value="../leftNav.jsp"></s:include>

<div id="content">
 
 
<div id="tabs">
	<ul>
		<li><s:a href="#tabs-1" action="testActionJsp.action">Project List</s:a></li>
	</ul>
	<div id="tabs-1">
		<s:if test="projects.size > 0">
			<table id="projects">
				<tr>
					<td>id</td>
					<td>Title</td>
					<td>Status</td>
					<td>Start date</td>
					<td>End date</td>
					<td>Iteration length</td>
				</tr>
				
				<s:iterator value="projects" status="projectsStatus">
					<s:if test="#projectsStatus.even == true">
						<tr style="background-color: #ffffff;"> 
							<s:url id="editProject" value="editProjectForm.action">
									<s:param name="editProjectForm" value="true" />
									<s:param name="projectId" value="projectId" />
							</s:url>
							<td>
								<s:a href="%{editProject}">
									<s:property value="projectId" />
								</s:a>
							</td>
							<td>
								<s:a href="%{editProject}">
									<s:property value="title" />
								</s:a>
							</td>
							<td><s:property value="status"/></td>
							<td><s:property value="startDate"/></td>
							<td><s:property value="predictedEndDate"/></td>
							<td><s:property value="currentIterationNumber"/></td>
							
							<td><s:url id="deleteProject" value="deleteProject.action">
								<s:param name="projectId" value="projectId" />
							</s:url> <s:a href="%{deleteProject}">Delete</s:a></td>
						</tr>
					</s:if>
					<s:else>
						<tr style="background-color: green;">
							<s:url id="editProject" value="editProjectForm.action">
									<s:param name="editProjectForm" value="true" />
									<s:param name="projectId" value="projectId" />
							</s:url>
							<td>
								<s:a href="%{editProject}">
									<s:property value="projectId" />
								</s:a>
							</td>
							<td>
								<s:a href="%{editProject}">
									<s:property value="title" />
								</s:a>
							</td>
							<td><s:property value="status"/></td>
							<td><s:property value="startDate"/></td>
							<td><s:property value="predictedEndDate"/></td>
							<td><s:property value="currentIterationNumber"/></td>
							
							<td><s:url id="deleteProject" value="deleteProject.action">
								<s:param name="projectId" value="projectId" />
							</s:url> <s:a href="%{deleteProject}">Delete</s:a></td>
						</tr>
					</s:else>
				</s:iterator>
			</table>
		</s:if>
	</div>
</div>

</body>
</html>